import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { NestExpressApplication } from '@nestjs/platform-express';
import { LoginGuard } from './login.guard';
import { TimeInterceptor } from './time.interceptor';

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  app.useStaticAssets('public', { prefix: '/static' });
  app.useGlobalGuards(new LoginGuard()); // add login guard
  app.useGlobalInterceptors(new TimeInterceptor()); // add interceptor
  await app.listen(3000);
}
bootstrap();
